package edu.kit.los.event;

import java.util.Date;

import edu.kit.los.util.Converter;

/**
 * @author felix
 * Hilfsklasse um FacebookJSON Objekte mithilfe der com.google.json library automatisch zu parsen. 
 */
public class FacebookEvent implements EventPrototype {

	private String name;
	private String description;
	private String start_time;
	private String end_time;
	private String privacy;
	private String updated_time;
	private String location;
	private String id;
	private ownerClass owner;
	private geoClass venue;
	
	
	static class ownerClass{
		private String name;
		private String id;
		/**
		 * leerer Konstruktor wird für Json benötigt.
		 */
		public ownerClass(){
		}
	}
	private ownerClass[] eventArray;
	
	static class geoClass{
		private double latitude;
		private double longitude;
		private String id;
		/**
		 * leerer Konstruktor wird für gson benötigt
		 */
		public geoClass(){
		}
	}

	public String getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getDescription() {
		if (description == null) return "";
		try{
			return description;
		}
		catch (Exception e) {
			return "";
		}
	}

	public Date getStart_time() {
		return Converter.FacebookDate2JavaDate(start_time);
	}

	public Date getEnd_time() {
		return Converter.FacebookDate2JavaDate(end_time);
	}

	public String getPrivacy() {
		return privacy;
	}

	public Date getUpdated_time() {
		return Converter.FacebookDate2JavaDate(updated_time);
	}

	public String getLocation() {
		return location;
	}
	
	public String getOwnerName() {
		if (owner == null) return "";
		try{
			return owner.name;
		}
		catch (Exception e) {
			return "";
		}
	}

	public String getOwnerID() {
		if (owner == null) return "";
		return owner.id;
	}

	public double getGeoLat() {
		if (venue==null) return 0;
		try{
			return venue.latitude;
		}
		catch (Exception e) {
			return 0;
		}
	}
	
	public double getGeoLong() {
		if (venue==null) return 0;
		try{
			return venue.longitude;
		}
		catch (Exception e) {
			return 0;
		}
	}
	
	public String getGeoID() {
		if (venue==null) return "";
		try{
			return venue.id;
		}
		catch (Exception e) {
			return "";
		}
	}


	public String getURL() {
		// TODO Auto-generated method stub
		return null;
	}
	
	
	
	
}
